Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let remove_redundant_constraints return an empty list if infeasible #3623

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

schillic
Copy link
Member

Currently, remove_redundant_constraints returns an EmptySet if the constraints are contradicting. I think this is unexpected. Instead, I suggest to return nothing.

@schillic schillic added the breaking ❌ This change may break things label Jul 26, 2024
@schillic schillic marked this pull request as ready for review July 26, 2024 15:02
@@ -253,8 +253,7 @@ function remove_redundant_constraints(constraints::AbstractVector{S};
if remove_redundant_constraints!(constraints_copy; backend=backend)
return constraints_copy
else # the constraints are infeasible
N = eltype(first(constraints))
return EmptySet{N}(dim(constraints[1]))
return nothing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe lets instead return an array of the same type as constraints if it failed to find a reduction.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@schillic schillic changed the title Let remove_redundant_constraints return nothing Let remove_redundant_constraints return an empty list if infeasible Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking ❌ This change may break things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants